﻿using MassPokerTool.Infrastructure.Hooking.Data;
using MassPokerTool.Infrastructure.Logging;

namespace MassPokerTool.Infrastructure.Hooking.Handlers
{
    public class ErrorHookHandler : IHookHandler
    {
        private readonly ILogger _log;

        public ErrorHookHandler(ILogger log)
        {
            _log = log;
        }

        public void Handle(IHookData parameter)
        {
            var hookData = parameter as ErrorHookData;
            if (hookData != null)
            {
                _log.Error(hookData.Exception);
            }
        }
    }
}
